Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ChatTemplate] Fix chat template for Gemma when answer is contained within question. #9462

Conversation

lvdongyi
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Description

Fix chat template for Gemma when answer is contained within question:

  1. generate all split_positions.
  2. filter split_positions according to <start_of_turn>. (The last <start_of_turn> before split_position must be immediately followed by model. )
  3. generate non_learnable_parts according to filtered_positions.

This PR is related to #9444

Copy link

paddle-bot bot commented Nov 20, 2024

Thanks for your contribution!

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 53.03%. Comparing base (79bba4f) to head (ecc3177).
Report is 9 commits behind head on develop.

Files with missing lines Patch % Lines
paddlenlp/transformers/gemma/tokenizer.py 91.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9462      +/-   ##
===========================================
+ Coverage    52.70%   53.03%   +0.32%     
===========================================
  Files          677      679       +2     
  Lines       109391   109626     +235     
===========================================
+ Hits         57658    58137     +479     
+ Misses       51733    51489     -244     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Collaborator

@DrownFish19 DrownFish19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

逻辑没有问题,不过这种方式和chat_template依赖太大。后续Todo设计通用方法,适配多种chat_template。

@DrownFish19 DrownFish19 merged commit 872aafa into PaddlePaddle:develop Nov 21, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants